class AddressChosePoiModel {
  List<AddressChosePoiDataModel>? poi;

  AddressChosePoiModel.fromJson(Map jsonMap) {
    poi = [];
    if (jsonMap['pois'] != null) {
      List mapList = jsonMap['pois'];
      for (int i = 0; i < mapList.length; i++) {
        Map element = mapList[i];
        AddressChosePoiDataModel model =
            AddressChosePoiDataModel.fromJson(element);
        model.isChose = i == 0 ? true : false;
        poi?.add(model);
      }
    }
  }
}

class AddressChosePoiDataModel {
  dynamic address;
  String? name;
  String? location;
  String pname='';
  String cityname='';
  String adname='';
  bool isChose = false;
  double latitude = 0;
  double longitude = 0;

  AddressChosePoiDataModel();

  AddressChosePoiDataModel.fromJson(Map jsonMap) {
    address = jsonMap['address'];
    name = jsonMap['name'];
    location = jsonMap['location'];
    pname = jsonMap['pname']??'';
    cityname = jsonMap['cityname']??'';
    adname = jsonMap['adname']??'';
    String locationStr = jsonMap['location'];
    List locationList = locationStr.split(',');
    latitude = double.parse(locationList.last);
    longitude = double.parse(locationList.first);
  }
}
